<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站后台管理系统</title>
<meta name="keywords" content="">
<meta name="description" content="">
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie6.css"/>
<![endif]-->
<link rel="stylesheet" type="text/css"  href="../../../../Public/admin/css/style_v2.0.css"/>
<link rel="stylesheet" type="text/css"  href="../../../../Public/layui/css/layui.css">
<link rel="stylesheet" type="text/css"  href="__PUBLIC__/admin/css/style_v2.0.css"/>
<link rel="stylesheet" type="text/css"  href="__PUBLIC__/layui/css/layui.css">
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
</head>
<body>
<div class="position mt10">当前位置：<a href="/admin/">后台首页</a> > 网站信息修改</div>
<div id="container">
  <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
      <legend>网站信息修改</legend>
  </fieldset>
<div class="c"></div> 
<form name=reg action="{:U('Admin/Web/domain_update',array('did' => $data['did']))}"  enctype="multipart/form-data"  method="post"  class="layui-form">
<div class="layui-form" style="background-color:#FFFFFF;">
    <table class="layui-table">
    <tr>
	  <td width="15%" align="right"><font color=red size="1">·</font>网站域名：</td>
	  <td width="85%"><input name="weburl" type="text" id="weburl" value="{$data.weburl}" required  lay-verify="weburl" placeholder="网站域名" autocomplete="off" class="layui-input" style="width:400px; float:left"> 
      <span class="table_txt">&nbsp;&nbsp;所属分组</span>
      <span class="table_span" style="width:150px; padding-left:0px;"><select name="gid" lay-verify="" lay-filter="gid">
           <option value="">请选择账号</option>
           <volist name="group" id="g">
           <option value="{$g.gid}"  <if condition="$data['gid'] eq $g['gid']">selected</if>>{$g.groupname}</option>
           </volist>
        </select>
      </span>
      </td>
    </tr>
    <tr>
	  <td width="15%" align="right"><font color=red size="1">·</font>网站名称：</td>
	  <td width="85%"><input name="webname" type="text" id="webname" value="{$data.webname}" required  lay-verify="webname" placeholder="网站名称" autocomplete="off" class="layui-input" style="width:400px; float:left"> </td>
    </tr>
    <tr>
	  <td width="15%" align="right"><font color=red size="1">·</font>域名时间：</td>
	  <td width="85%">
      <input name="dstart" type="text" id="dstart" value="{$data.dstart|date='Y-m-d',###}"  placeholder="开始日" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD'})" class="layui-input ico-date"  style="width:150px; float:left;">
      <span class="table_span">~</span>
      <input name="dend" type="text" id="dend" value="{$data.dend|date='Y-m-d',###}"  placeholder="结束日" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD'})" class="layui-input ico-date"  style="width:150px; float:left;">
      </td>
    </tr>
    <tr>
	  <td align="right">域名管理权：</td>
	  <td><input type="radio" name="isowner" value="1"  lay-filter="isowner" title="在我处" <if condition="$data['isowner'] eq 1">checked </if>> &nbsp;&nbsp;&nbsp; <input type="radio" name="isowner" value="0" title="不在我处"   lay-filter="isowner" <if condition="$data['isowner'] eq 0">checked </if>></td>
	</tr>
    <tr id="webaccount">
	  <td align="right">域名所在账号：</td>
	  <td>
      <span class="table_span" style="width:150px; padding-left:0px;"><select name="webaccount" lay-verify="" lay-filter="">
           <option value="0">请选择账号</option>
           <volist name="account" id="b">
           <option value="{$b.aid}" <if condition="$data['webaccount'] eq $b['aid']">selected</if>>{$b.aname}</option>
           </volist>
        </select>
      </span>
      </td>
	</tr>
    <tr id="quanxian">
	  <td align="right">域名管理信息：</td>
	  <td>
          <div class="fee_box"><span class="table_txt">域名管理入口：</span><span style="width:400px; float:left;"><input name="dinfo[0]" type="text" id="dinfo" value="{$dinfo[0]}"  autocomplete="off" class="layui-input" placeholder="http://" ></span></div>
          <div class="fee_box"><span class="table_txt">域名管理账号：</span><span style="width:400px; float:left;"><input name="dinfo[1]" type="text" id="dinfo" value="{$dinfo[1]}"  autocomplete="off" class="layui-input" placeholder="" ></span></div>
          <div class="fee_box"><span class="table_txt">域名管理密码：</span><span style="width:400px; float:left;"><input name="dinfo[2]" type="text" id="dinfo" value="{$dinfo[2]}"  autocomplete="off" class="layui-input" placeholder="" ></span></div>
      </td>
	</tr>
    <tr>
	  <td align="right">域名状态：</td>
	  <td><input type="radio" name="status" value="1" title="正常" <if condition="$data['status'] eq 1">checked </if> > &nbsp;&nbsp;&nbsp; <input type="radio" name="status" value="0" title="过期" <if condition="$data['status'] eq 0">checked </if>> </td>
	</tr>
    <tr>
	  <td align="right">是否可以访问：</td>
	  <td><input type="radio" name="work" value="1" title="可以" <if condition="$data['work'] eq 1">checked </if> > &nbsp;&nbsp;&nbsp; <input type="radio" name="work" value="0" title="无法访问" <if condition="$data['work'] eq 0">checked </if>> </td>
	</tr>
    <tr>
	  <td align="right">网站源码：</td>
	  <td><input name="codetype" type="text" id="codetype" value="{$data.codetype}" autocomplete="off" placeholder="网站源码类型" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">网站到期日：</td>
	  <td><input name="endtime" type="text" id="endtime" value="{$data.endtime|date='Y-m-d',###}"  placeholder="到期日" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD'})" class="layui-input ico-date"  style="width:150px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">网站截图：</td>
	  <td>
      <notempty name="data.photo"><span style="float:left;"><img src="__ROOT__{$data.photo}" height="70" style="max-width:180px; padding-right:10px;"></span></notempty>
      <input name="photo1" type="text" id="photo1" value="{$data.photo}" autocomplete="off" class="layui-input" style="width:500px;">
      <input type='file'  name='photo' multiple></td>
	</tr>
	<tr>
    <tr>
	  <td align="right">续费价格：</td>
	  <td><input name="price" type="text" id="price" value="{$data.price}" autocomplete="off" placeholder="￥" lay-verify="price" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    </table>
    </div>
    <div class="layui-form" style="background-color:#FFFFFF;">
    <blockquote class="layui-elem-quote">服务器信息</blockquote>
    <table class="layui-table">
	<tr>
	  <td width="15%" align="right">服务器类型：</td>
	  <td>
      <span class="table_span" style="width:150px; padding-left:0px;">
        <select name="hosttype" lay-verify="" lay-filter="">
             <option value="{$data.hosttype}">{$hosttype[$data['hosttype']]}</option>
             <option value="0">独立服务器</option>
             <option value="1">虚拟主机</option>
             <option value="2">云虚拟主机</option>
        </select>
      </span>
      </td>
	</tr>
    <tr>
	  <td align="right">服务器ip：</td>
	  <td><input name="hostip" type="text" id="hostip" value="{$data.hostip}" autocomplete="off" placeholder="IP" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">所在账号：</td>
	  <td>
       <span class="table_span" style="width:150px; padding-left:0px;">
          <select name="hostaccount" lay-verify="" lay-filter="">
          <option value="">请选择账号</option>
           <volist name="account" id="a">
           <option value="{$a.aid}" <if condition="$data['hostaccount'] eq $a['aid']">selected</if>>{$a.aname}</option>
           </volist>
        </select>
      </span>
      </td>
	</tr>
    <tr>
	  <td width="15%" align="right"><font color=red size="1">·</font>服务器时间：</td>
	  <td width="85%">
      <input name="hoststart" type="text" id="hoststart" value="{$data.hoststart|date='Y-m-d',###}"  placeholder="开始日" class="layui-input ico-date"  style="width:150px; float:left;">
      <span class="table_span">~</span>
      <input name="hostend" type="text" id="hostend" value="{$data.hostend|date='Y-m-d',###}"  placeholder="结束日" class="layui-input ico-date"  style="width:150px; float:left;">
      </td>
    </tr>
     <tr>
	  <td align="right">是否备案：</td>
	  <td><input type="radio" name="isbeian" value="1" id="isbeian1"  lay-filter="isbeian" title="已备案" <if condition="$data['isbeian'] eq 1">checked='checked' </if> > &nbsp;&nbsp;&nbsp; <input type="radio" name="isbeian" id="isbeian2" value="0" title="未备案"  lay-filter="isbeian" <if condition="$data['isbeian'] eq 0">checked='checked' </if>> </td>
	</tr>
    <tr id="beian_tr">
	  <td align="right">备案信息：</td>
	  <td>
         <span class="table_span" style="width:400px; padding-left:0px;">
             <input name="beian" type="text" id="beian" value="{$data.beian}" autocomplete="off" placeholder="备案号" class="layui-input">
         </span>
         <span class="table_txt">（选择分组时会自动填写备案号）</span>
      </td>
	</tr>
    <tr>
	  <td align="right">FTP信息：</td>
	  <td>
          <div class="fee_box"><span class="table_txt">FTP地址：</span><span style="width:400px; float:left;"><input name="ftp[0]" type="text" id="ftp" value="{$ftp[0]}"  autocomplete="off" class="layui-input" placeholder="" ></span></div>
          <div class="fee_box"><span class="table_txt">FTP账号：</span><span style="width:400px; float:left;"><input name="ftp[1]" type="text" id="ftp" value="{$ftp[1]}"  autocomplete="off" class="layui-input" placeholder="" ></span></div>
          <div class="fee_box"><span class="table_txt">FTP密码：</span><span style="width:400px; float:left;"><input name="ftp[2]" type="text" id="ftp" value="{$ftp[2]}"  autocomplete="off" class="layui-input" placeholder="" ></span></div>
      </td>
	</tr>
    </table>
    </div>
    <div class="layui-form" style="background-color:#FFFFFF;">
    <blockquote class="layui-elem-quote">联系人信息</blockquote>
    <table class="layui-table">
    <tr>
	  <td width="15%" align="right">联系人：</td>
	  <td>
      <span class="table_span" style="width:150px; padding-left:0px;">
      <input name="linkman" type="text" id="linkman" value="{$data.linkman}" autocomplete="off" placeholder="联系人" class="layui-input" ></span>
      <span class="table_txt">&nbsp;&nbsp;&nbsp;快速选择客户:</span>
      <span class="table_span" style="width:150px; padding-left:0px;">
          <select name="fastselect" lay-verify="" lay-filter="fastselect">
          <option value="">请选择客户</option>
           <volist name="customer" id="c">
           <option value="{$c.cid}">{$c.cuname}</option>
           </volist>
        </select>
      </span>
      <span class="table_txt" style="color:#FF0000;">快速选择会清空你之前填写的联系方式，请谨慎</span>
      </td>
	</tr>
	<tr>
	  <td align="right">电话：</td>
	  <td><input name="phone" type="text" id="phone" value="{$data.phone}" autocomplete="off" placeholder="电话" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">微信：</td>
	  <td><input name="wechat" type="text" id="wechat" value="{$data.wechat}" autocomplete="off" placeholder="微信" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">Q Q：</td>
	  <td><input name="qq" type="text" id="qq" value="{$data.qq}" autocomplete="off" placeholder="QQ" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">渠道姓名：</td>
	  <td><input name="qudao" type="text" id="qudao" value="{$data.qudao}" autocomplete="off" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
	<tr>
	  <td align="right">其他信息：</td>
	  <td><textarea name="content" id="content" placeholder="请输入内容" class="layui-textarea">{$data.content}</textarea></td>
	  </tr>
	   <tr>
	     <td align="right">排序：</td>
	     <td><span class="table_txt"><input type="text" name="listorder" value="{$data.listorder}" class="layui-input" style="width:50px;"></span>
            <span class="table_txt"><font color="#666666">（越大越靠前）</font></span></td>
        </tr>
	   <td align="right"><font color=red size="1">·</font>添加时间：</td>
	  <td><input name="inputtime" type="text" id="inputtime" value="{$data.inputtime|date='Y-m-d H:i:s',###}"  autocomplete="off" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" class="layui-input ico-date"  style="width:250px; float:left;"></td>
	  </tr>
      <tr> 
	  <td colspan=3 align="center" valign="middle">
		<input type="submit" name="Submit" value="确&nbsp; &nbsp;定" class="layui-btn" >
		<input type="reset" name="Submit2" value="重　置" class="layui-btn layui-btn-primary" >		 </td>
	</tr>
    </table>
    </div>
 </form>
</div>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
</body>
</html>
<script>

//Demo
layui.use(['form','laydate'], function(){
  var form = layui.form;
  var laydate = layui.laydate;
   //,layer = layui.layer	
   
   laydate.render({
    elem: '#dstart'
	,type: 'date'
  });
  
   laydate.render({
       elem:'#dend'
	   ,type:'date'
   });
   
  laydate.render({
    elem: '#hoststart'
	,type: 'date'
  });
  laydate.render({
    elem: '#endtime'
	,type: 'date'
  });
   laydate.render({
       elem:'#hostend'
	   ,type:'date'
   });
   laydate.render({
       elem:'#inputtime'
	   ,type:'datetime'
   });
   
  
   var isowner = $("input[name='isowner']:checked").val();
   if(isowner == 0){
        $("#quanxian").css('display','');
        $("#webaccount").css('display','none');
   }else{
        $("#quanxian").css('display','none');
        $("#webaccount").css('display','');
   }
   form.on('radio(isowner)', function(data){
        $val = data.value;
		if($val=="" || $val =="0"){
		   $("#quanxian").css('display','');
		   $("#webaccount").css('display','none');
		}else{
		   $("#webaccount").css('display','');
		   $("#quanxian").css('display','none');
		}
   });
   
   /*获取是否备案信息*/
    var isbeian = $("input[name='isbeian']:checked").val();
   if(isbeian == 0){
        $("#beian_tr").css('display','none');
   }else{
        $("#beian_tr").css('display','');
   }
   form.on('radio(isbeian)', function(data){
        $val = data.value;
		if($val=="" || $val =="0"){
		   $("#beian_tr").css('display','none');
		}else{
		   $("#beian_tr").css('display','');
		}
   });
   
   /*监听分组自动填表备案信息*/
   form.on('select(gid)', function(data){
       $gid = data.value;
	   if($gid != 1){
	       $.ajax({
		       url:"{:U('Web/ajaxget_beian')}",
			   dataType:'json',
			   type:'get',
			   data:{'gid': $gid },
			   success:function(data){
			       if(data.length){
			           $("input[name=beian]").val(data);
					   $("input[name='isbeian'][value=1]").prop("checked",'checked');
					   $("input[name='isbeian'][value=0]").prop("checked","");
					   $("#beian_tr").css('display','');//如果备案信息框为隐藏则显示
					   form.render();
				   }else{
				        $("input[name=beian]").val("");
				   }
			   }
		   });
	   }
   });
   
   /*快速选择客户  自动填表*/
   form.on('select(fastselect)', function(data){
       $cid = data.value;
	   if($cid){
	       $.ajax({
		       url:"{:U('Customer/ajaxget_cus')}",
			   dataType:'json',
			   type:'get',
			   data:{'cid': $cid },
			   success:function(data){
                   data = eval('(' + data + ')');
			       if(data){
			           $("#linkman").val(data.cuname);
					   $("#phone").val(data.cphone);
					   $("#wechat").val(data.cwechat);
					   $("#qq").val(data.cqq);
					   if(data.ctype == 1){
					      $("#qudao").val("直属客户");
					   }
					   form.render();
				   }else{
				        $("input[name=beian]").val("");
				   }
			   }
		   });
	   }
   });
   
   
   form.verify({
        webname: function(value){
		    if(value !="" || value.length  >0){
			    
			}else{
			   return '请填写网址名称';
			}
		}
		,weburl: function(value){
		    if(value == "" || value.length ==0){
			return '请填写网站域名！';
			}
		}    
	   ,price: function(value){
	       if(value != ""){
			   if(!new RegExp(/^\d*$/).test(value)){
		            return '必须是数字0';
		       }
		   }else{
		      return '请填写价格！'
		   }
	   }
   });
   
   
  //监听提交
  form.on('submit(formSearch)', function(data){
    //layer.msg(JSON.stringify(data.field));
	title: '最终的提交信息'
	return true;
  });

});

</script>